<template>
    <view class="content">
        <view class="box">
            <view class="o-nav">
                <view class="o-nav-i" :class="{active : header == 0}" @click="chooseHeader(0)">全部订单</view>
                <view class="o-nav-i" :class="{active : header == 1}" @click="chooseHeader(1)">周期服务</view>
            </view>
            <view class="t-nav">
                <view class="t-nav-i" v-if="header == 0" :class="{Tactive : type == 1}" @click="chooseNav(1)">未支付</view>
                <view class="t-nav-i" :class="{Tactive : type == 2}" @click="chooseNav(2)">服务中</view>
                <view class="t-nav-i" :class="{Tactive : type == 3}" @click="chooseNav(3)">已完成</view>
            </view>
        </view>
        
        <view class="wrapper">
            <view class="item" v-for="(item, index) in 2" :key="index" @click="toDetails(item)">
                <view class="title">伙伴计时 陪学习 数学</view>
                <view class="time">2023-10-27(星期五) 19:30-20:00</view>
                <view class="item-down">
                    <image :src="IMAGEURL + 'static/icon/icon_01.png'" class="icon-01"></image>
                    <view class="name">李同学</view>
                    <view class="male">男</view>
                    <view class="female">女</view>
                    <view class="age">12岁</view>
                </view>
                <view class="down">
                    <view>
                        <view class="tip">
                            <image :src="IMAGEURL + 'static/icon/tip.png'" class="tip-icon"></image>
                            <view>取消服务需提前1小时</view>
                        </view>
                    </view>
                    <view class="btns">
                        <view class="btn1" @click.stop="show = true">服务延期</view>
                        <view class="btn2" @click.stop="$gTo(`../order/cancel-order?id=${item.id}`)">取消服务</view>
                        <!-- <view class="btn3">立即评价</view> -->
                    </view>
                </view>
            </view>
        </view>
        
        <u-mask :show="show">
            <view class="privacy-pop">
                <view class="privacy-pop-box">
                    <view class="privacy-title">服务延期</view>
                    <view class="privacy-item">
                        <view>延期</view>
                        <view class="privacy-item-right" @click="show_1 = true">
                            <input type="text" class="privacy-inp" v-model="name" placeholder="请选择" disabled />
                            <u-icon name="arrow-down-fill" color="#666666" size="24"></u-icon>
                        </view>
                    </view>
                    <view class="privacy-item">
                        价格：￥<text class="u-font-36 text-bold">200</text>
                    </view>
                    <view class="btn-text2" @click.stop="doSubmit">确认延期</view>
                    <image :src="IMAGEURL + 'static/icon/close_02.png'" class="close" @click="show = false"></image>
                </view>
            </view>
        </u-mask>
        
        <u-select v-model="show_1" mode="single-column" :list="courseList" value-name="id" label-name="goods_name" @confirm="confirm($event, 1)"></u-select>
        
        <!-- 底部导航 -->
        <u-tabbar v-model="current" :list="tab_list" active-color="#f29700" :border-top="false" height="120" @change="tabbarChange"></u-tabbar>
    </view>
</template>

<script>
    import { IMAGEURL } from '@/static/js/common.js';
    export default {
        data() {
            return {
                IMAGEURL,
                current: 0, //底部导航索引
                tab_list: [
                    {
                        iconPath: "/static/icon/tab.png",
                        selectedIconPath: "/static/icon/tab.png",
                        text: '',
                        pagePath: "/pages/tabbar/index",
                        customIcon: false
                    },{
                        iconPath: "/static/icon/tab_01.png",
                        selectedIconPath: "/static/icon/tab_02.png",
                        text: '订单',
                        customIcon: false,
                        pagePath: "/pages/tabbar/order"
                    },{
                        iconPath: "/static/icon/tab_03.png",
                        selectedIconPath: "/static/icon/tab_04.png",
                        text: '活动',
                        customIcon: false,
                        pagePath: "/pages/tabbar/activity"
                    },{
                        iconPath: "/static/icon/tab_05.png",
                        selectedIconPath: "/static/icon/tab_06.png",
                        text: '我的',
                        customIcon: false,
                        pagePath: "/pages/tabbar/mine"
                    }
                ],
                header: 0, //0全部 1周期
                type: 2,//1未支付 2服务中 3已完成
                show: false,
                show_1: false,
            };
        },
        onLoad() {
            
        },
        methods: {
            toDetails(item) {
                this.$gTo(`../order/details`)
            },
            
            chooseHeader(num) {
                this.header = num
            },
            
            chooseNav(num) {
                this.type = num
            },
            
            //切换底部导航
            tabbarChange(e) {
            	this.current = e;
            },
        }
    };
</script>

<style>
    .u-tabbar__content__item .u-icon__img {
    	width: 50rpx !important;
    	height: 50rpx !important;
    }
    .u-tabbar__content>.u-tabbar__content__item:first-child .u-icon__img{
        width: 100rpx !important;
        height: 100rpx !important;
    }
</style>

<style lang="scss">
    // 弹窗
    .privacy-pop {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100%;
    }
    
    .privacy-pop-box {
        width: 580rpx;
        padding: 40rpx;
        background-color: #fff;
        box-sizing: border-box;
        border-radius: 20rpx;
        position: relative;
    }
    
    .privacy-title {
        font-size: 32rpx;
        font-weight: bold;
        text-align: center;
        padding-bottom: 30rpx;
    }
    
    .privacy-item {
        margin-bottom: 20rpx;
    }
    
    .privacy-item>view {
        margin-bottom: 10rpx;
    }
    
    .privacy-item-right {
        display: flex;
        justify-content: space-between;
        align-items: center;
        background-color: #f8f8f8;
        border-radius: 10rpx;
        padding: 20rpx;
    }
    
    .privacy-inp {
        flex: 1;
        // height: 77rpx;
        // line-height: 77rpx;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .btn-text2 {
        font-size: 30rpx;
        color: #fff;
        background-color: #f29700;
        padding: 20rpx 60rpx;
        border-radius: 20rpx;
        margin: 0 20rpx;
        text-align: center;
    }
    
    .close {
        width: 58rpx;
        height: 58rpx;
        position: absolute;
        left: 35vw;
        bottom: -100upx;
    }
    
    
    page{
        background-color: #f5f5f5;
    }
    .box{
        background-color: #fff;
        padding-top: 20rpx;
    }
    .o-nav{
        width: 415rpx;
        height: 64rpx;
        background-color: #a2a8b7;
        border-radius: 15rpx;
        padding: 2rpx;
        display: flex;
        justify-content: center;
        align-items: center;
        margin: auto;
    }
    .o-nav-i{
        width: calc(411rpx / 2);
        font-size: 28rpx;
        color: #fff;
        text-align: center;
        line-height: 60rpx;
    }
    .active{
        font-size: 30rpx;
        color: #a2a8b7;
        background-color: #fff;
        border-radius: 15rpx;
    }
    .t-nav{
        display: flex;
        justify-content: space-around;
        align-items: center;
    }
    .t-nav-i{
        padding: 30rpx 0 20rpx;
        font-size: 28rpx;
        color: #565656;
    }
    .Tactive{
        font-size: 32rpx;
        color: #000;
        font-weight: bold;
        position: relative;
    }
    .Tactive::after{
        display: block;
        content: '';
        width: 32rpx;
        height: 8rpx;
        background-color: #f29700;
        position: absolute;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .wrapper{
        padding: 20rpx;
    }
    .item{
        padding: 35rpx 25rpx;
        margin-bottom: 20rpx;
        background-color: #fff;
        border-radius: 15rpx;
    }
    .title{
        font-size: 34rpx;
        font-weight: bold;
        word-break: break-all;
        white-space: pre-line;
    }
    .time{
        font-size: 26rpx;
        color: #8e8e8e;
        padding-top: 10rpx;
    }
    .item-down{
        display: flex;
        justify-content: flex-start;
        align-items: center;
        padding-top: 20rpx;
    }
    .icon-01{
        width: 37rpx;
        height: 37rpx;
        margin-right: 15rpx;
    }
    .name{
        font-size: 32rpx;
        font-weight: bold;
        padding-right: 15rpx;
    }
    .male{
        width: 34rpx;
        height: 34rpx;
        border-radius: 5rpx;
        background-color: #edf6ff;
        font-size: 26rpx;
        color: #2d96fa;
        text-align: center;
        line-height: 34rpx;
    }
    .female{
        width: 34rpx;
        height: 34rpx;
        border-radius: 5rpx;
        background-color: #ffeeed;
        font-size: 26rpx;
        color: #ff5748;
        text-align: center;
        line-height: 34rpx;
    }
    .age{
        font-size: 26rpx;
        color: #727272;
        padding-left: 15rpx;
    }
    
    .down{
        padding-top: 10rpx;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .tip{
        font-size: 24rpx;
        color: #ff5748;
        display: flex;
        justify-content: flex-start;
        align-items: center;
    }
    .tip-icon{
        width: 26rpx;
        height: 26rpx;
        margin-right: 10rpx;
    }
    .btns{
        display: flex;
        justify-content: flex-end;
        align-items: center;
    }
    .btns>view{
        font-size: 28rpx;
        padding: 10rpx 20rpx;
        border-radius: 10rpx;
        margin-left: 20rpx;
        box-sizing: border-box;
    }
    .btn1{
        color: #fff;
        background-color: #f29700;
    }
    .btn2{
        border: 2rpx solid #eeeeee;
    }
    .btn3{
        background-color: #fffcf8;
        border: 2rpx solid #f29700;
    }
    

</style>
